/***********************************************************************
 * <copyright file="DataAccess.cs" company="BUCA JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Tuanhm
 * Email:    Tuanhm@humg@gmail.com
 * Website:
 * Create Date: Thursday, March 27, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/
using System.Configuration;
using BusinessObjects.BussinessVoucher;
using DataObjects.StandartInterfaces;
using DataObjects.StandartInterfaces.Dictionary;
using DataObjects.StandartInterfaces.Report;
using DataObjects.StandartInterfaces.Voucher;

namespace DataObjects
{
    /// <summary>
    /// This class shields the client from the details of database specific 
    /// data-access objects. It returns the appropriate data-access objects 
    /// according to the configuration in web.config.
    /// </summary>
    /// <remarks>
    /// GoF Design Patterns: Factory, Singleton, Proxy.
    /// 
    /// This class makes extensive use of the Factory pattern in determining which 
    /// database specific DAOs (Data Access Objects) to return.
    /// 
    /// This class is like a Singleton -- it is a static class (Shared in VB) and 
    /// therefore only one 'instance' will ever exist.
    /// 
    /// This class is a Proxy as it 'stands in' for the actual Data Access Object Factory.
    /// </remarks>
    public static class DataAccess
    {
        // The static field initializers below are thread safe.
        // Furthermore, they are executed in the order in which they appear
        // in the class declaration. Note: if a static constructor
        // is present you want to initialize these in that constructor.
        private static readonly string ConnectionStringName = ConfigurationManager.AppSettings.Get("ConnectionStringName");
        private static readonly IDaoFactory Factory = DaoFactories.GetFactory(ConnectionStringName);
        #region Security

        #endregion

        #region Dictionary

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IVoucherTypeDao VoucherTypeDao { get { return Factory.VoucherTypeDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IRefTypeDao RefTypeDao { get { return Factory.RefTypeDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IEmployTest EmployTestDao { get { return Factory.EmployTest; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IAccountDao AccountDao { get { return Factory.AccountDao; } }  


     

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IFixedAssetDao FixedAssetDao { get { return Factory.FixedAssetDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IFixedAssetCategoryDao FixedAssetCategoryDao { get { return Factory.FixedAssetCategoryDao; } }
        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IUnitDao UnitDao { get { return Factory.UnitDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IVendorDao VendorDao { get { return Factory.VendorDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IStockDao StockDao { get { return Factory.StockDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IInventoryItemDao InventoryItemDao { get { return Factory.InventoryItemDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IDepartmentDao DepartmentDao { get { return Factory.DepartmentDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IDbOptionDao DbOptionDao { get { return Factory.DbOptionDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static ICustomerDao CustomerDao { get { return Factory.CustomerDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IAutoNumberDao AutoNumberDao { get { return Factory.AutoNumberDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IAutoBusinessDao AutoBusinessDao { get { return Factory.AutoBusinessDao; } }   

        #endregion

        #region  Voucher

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IOpeningAccountEntryDao OpeningAccountEntryDao { get { return Factory.OpeningAccountEntryDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IOpeningAccountEntryDetailDao OpeningAccountEntryDetailDao { get { return Factory.OpeningAccountEntryDetailDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static ITaxTransDao TaxTransDao { get { return Factory.TaxTransDao; } }


        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IJournalEntryAccountDao JournalEntryAccountDao { get { return Factory.JournalEntryAccountDao; } }

        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IAccountBalanceDao AccountBalanceDao { get { return Factory.AccountBalanceDao; } }


        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IItemTransactionDao ItemTransactionDao { get { return Factory.ItemTransactionDao; } }


        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IItemTransactionDetailDao ItemTransactionDetailDao { get { return Factory.ItemTransactionDetailDao; } }    

        #endregion

        #region Report
        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IReportListDao ReportListDao { get { return Factory.ReportListDao; } }
        /// <summary>
        /// Gets the i employ test DAO.
        /// </summary>
        /// <value>
        /// The i employ test DAO.
        /// </value>
        public static IReportGroupDao ReportGroupDao { get { return Factory.ReportGroupDao; } }  
        #endregion
    }
}